home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / fish / 726-750 / 742 / pal / pal.c < prev    next >
C/C++ Source or Header  |  1995-03-18  |  2KB  |  81 lines

  1.  
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <utility/tagitem.h>
  5. #include <exec/types.h>
  6. #include <clib/exec_protos.h>
  7. #include <workbench/startup.h>
  8. #include <intuition/intuition.h>
  9. #include <intuition/screens.h>
  10. #include <clib/intuition_protos.h>
  11. #include <clib/utility_protos.h>
  12. #include <graphics/displayinfo.h>
  13. #include <graphics/view.h>
  14. #include <string.h>
  15.  
  16. int main(int argc, char *argv[]);
  17. int wbmain(struct WBStartup *);
  18. extern struct IntuitionBase *IntuitionBase;
  19. extern int LVOOpenScreen;
  20. struct Screen *MyOpenScreen(__A0 struct NewScreen *, __A6 struct IntuitionBase *);
  21. extern stubMyOpenScreen(__A0 struct NewScreen *,__A6 struct IntuitionBase *);
  22. struct Screen * (*oldOpenScreen)(__A0 struct ExtNewScreen *, __A6 struct IntuitionBase *);
  23.  
  24. __geta4 struct Screen *MyOpenScreen(__A0 struct NewScreen *ns, __A6 struct IntuitionBase *base)
  25.  {
  26.  struct ExtNewScreen ens;
  27.  struct Screen *s;
  28.  struct TagItem tag[] = {
  29.     { SA_DisplayID, 0 },
  30.     { TAG_DONE, 0 }
  31.  };
  32.  BOOL tagged = FALSE;
  33.  
  34.  if(!(ns->Type & NS_EXTENDED))
  35.    {
  36.    memcpy(&ens,ns,sizeof(struct NewScreen));
  37.    if(ens.ViewModes & LACE)
  38.      {
  39.      if( ((LONG)ens.Height) >= 512 )
  40.        {
  41.        if( ens.ViewModes & HIRES )
  42.          tag[0].ti_Data = PAL_MONITOR_ID | HIRESLACE_KEY;
  43.        else
  44.          tag[0].ti_Data = PAL_MONITOR_ID | LORESLACE_KEY;
  45.        tagged = TRUE;
  46.        }
  47.      }
  48.    else if ( ((LONG)ens.Height) >= 256 )
  49.      {
  50.      if( ens.ViewModes & HIRES )
  51.        tag[0].ti_Data = PAL_MONITOR_ID | HIRES_KEY;
  52.      else
  53.        tag[0].ti_Data = PAL_MONITOR_ID | LORES_KEY;
  54.      tagged = TRUE;
  55.      }
  56.   }
  57.  
  58.  if(tagged)
  59.    {
  60.    ens.Type |= NS_EXTENDED;
  61.    ens.Extension = tag;
  62.    s = oldOpenScreen(&ens,base);
  63.    }
  64.  else
  65.    s= oldOpenScreen((struct ExtNewScreen *)ns,base);
  66.  
  67.  return(s);
  68.  }
  69.  
  70. int wbmain(struct WBStartup *wb)
  71.   {
  72.   main(0,NULL);
  73.   }
  74.  
  75. int main(int argc, char *argv[])
  76.   {
  77.   oldOpenScreen = SetFunction(IntuitionBase,-198,stubMyOpenScreen);
  78.   Wait(0L);
  79.   }
  80.  
  81.